package com.example.my_flea_street.service.impl;

import com.example.my_flea_street.Mapper.UserMapper;
import com.example.my_flea_street.Mapper.UserViewMapper;
import com.example.my_flea_street.bean.Info;
import com.example.my_flea_street.bean.User;
import com.example.my_flea_street.service.UserViewService;
import com.github.pagehelper.Page;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service(value = "userViewService")
public class UserViewServiceImpl implements UserViewService {

    @Resource
    UserViewMapper userViewMapper;

    @Resource
    UserMapper userMapper;
    @Override
    public Page<Info> getInfo(int id, int type) {
        return userViewMapper.getInfo(id,type);
    }

    @Override
    public int getSettledCount(int user_id, int type) {
        return userViewMapper.getSettledCount(user_id,type);
    }

    @Override
    public User getUserById(int userId) {
        return userMapper.getUserById(userId);
    }

    public void deleteInfo(int id) {
        userViewMapper.deleteInfo(id);
    }

    public void settledInfo(int id) {
        userViewMapper.settledInfo(id);
    }

    public void report(int userId, String text, String release_time, String newPic) {
        userViewMapper.report(userId,text,release_time,newPic);
    }
}
